<html>
<head><meta charset="utf-8"><title>const fn satisfying `T: FnOnce` bounds in `const fn` · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20fn.20satisfying.20.60T.3A.20FnOnce.60.20bounds.20in.20.60const.20fn.60.html">const fn satisfying `T: FnOnce` bounds in `const fn`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219459032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20fn%20satisfying%20%60T%3A%20FnOnce%60%20bounds%20in%20%60const%20fn%60/near/219459032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20fn.20satisfying.20.60T.3A.20FnOnce.60.20bounds.20in.20.60const.20fn.60.html#219459032">(Dec 10 2020 at 11:16)</a>:</h4>
<p>I was looking at <code>Result::unwrap_or_else</code>, and I think we could make it <code>const fn</code> right now, but then there'd be no way to actually call it. I don't want to touch closures yet, but I think we should consider adding a feature gate that makes all <code>T: FnOnce</code> bounds satisfied for <code>const fn</code> being passed as the <code>T</code> (of course only if they'd also satisfy the bound ouside of const stuff)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>